package cn.kbyue.oauth2jwt.service.impl;

import cn.kbyue.oauth2jwt.domain.mapper.UserMapper;
import cn.kbyue.oauth2jwt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * @author XL
 * @version 0.1
 * @date 2021/7/24 17:38
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return userMapper.findByUsername(username);
    }
}
